import Img from "../model/Img";
import { userinfo, type asyncPromise } from "../interface";

export default {
  async insert(name: string) {
    const result = await Img.create({ imgUrl: name });
    return result.toJSON();
  },
  async findfilename(name: string) {
    const result = await Img.findOne({ where: { imgUrl: name } });
    if (!result) return null;
    return result.toJSON();
  },
};
